package com.yike.websocket.api.service;

import com.yike.websocket.api.param.MessageReminderFeignParam;
import com.yike.websocket.api.service.hystrix.WebSocketFeignHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Set;

@FeignClient(value = "websocket-service", fallback = WebSocketFeignHystrix.class)
public interface WebSocketFeignService {

    @PostMapping("/msg/send")
    public void send(@RequestParam("id") String id, @RequestParam("message") String message);

    @PostMapping("/msg/sendAll")
    public void sendAll(@RequestParam("message") String message);

    @PostMapping("/msg/sendUserList")
    public void sendAll(@RequestParam("userIds") Set<String> userIds, @RequestParam("message") String message);

    @PostMapping("/msg/sendMessageReminder")
    public void senMessageReminder(@RequestBody MessageReminderFeignParam messageReminderFeignParam);
}
